<template>
  <div>
    <van-card
      :num="item.count"
      v-for="item of selectCar"
      :key="item.id"
      :price="item.price"
      desc="描述信息"
      title="商品标题"
      thumb="https://img.yzcdn.cn/vant/cat.jpeg"
    />
    <van-submit-bar :price="selectCountSum.price" button-text="购买" @submit="onSubmit" />
  </div>
</template>

<script>
import { mapState, mapGetters } from "vuex";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapState(["car"]),
    ...mapGetters(["selectCountSum", "selectCar"])
  },
  methods: {
    onSubmit() {
      //购买
      this.$toast("购买成功");
      this.$store.commit("removeSelect");
      this.$router.back();
    }
  }
};
</script>

<style>
</style>